package DeportManage;

//Customer class which contains and Manage Customer details
//It will store the information about customers

public class Customer {

//Class variables are Parcel id, Customer name & Customer sequence number	
	private int Customer_SequenceNumber;
	private  Name Customer_Name;
	private String ID_Parcel;

	/**
	 * Constructor of the class Customer
	 * @param Customer_SequenceNumber, the sequence number of customer
	 * @param name, the name of Customer
	 * @param ID_Parcel, the ID of Parcel	 * 
	 * @throws NotFormatParcelIDException 
	 */
	public Customer (int Customer_SequenceNumber, Name name, String ID_Parcel) throws NotFormatParcelIDException
	{
		this.Customer_SequenceNumber = Customer_SequenceNumber;
		this.Customer_Name = name;
		
		String firstLetterOfID = ID_Parcel.substring(0,1);
		if(ID_Parcel.length() != 5)
			throw new NotFormatParcelIDException(ID_Parcel);
		if(!firstLetterOfID.equals("X") && !firstLetterOfID.equals("C"))
			throw new NotFormatParcelIDException(ID_Parcel);		
		this.ID_Parcel = ID_Parcel;
	}	
	/**
	 * Method to get the Sequence number of customers. 
	 * @return The Customer Sequence Number of type int.
	 */    
	public int getSequenceNo()
	{
		return Customer_SequenceNumber;
	}
	/**
	 * Method to get the ID of the Parcel.
	 * @return The Parcel ID of type String.
	 */    
	public String getParcelID()
	{
		return ID_Parcel;
	}	
	/**
	 * Method to get the name of the Customer.
	 * @return The Customer Name of type Name.
	 */    
	public Name getName()
	{
		return Customer_Name;
	}
}




